import React from "react"
import { useState } from "react"

export const StateDemo = () => {
  const [count, setCount] = useState(0)
  return (
    <>
      <h2>useState的使用</h2>
      <h3>当前计数: {count}</h3>
      <button onClick={() => setCount(count + 1)}>+1</button>
      <button onClick={() => setCount(count - 1)}>-1</button>
    </>
  )
}